package com.cakebackoffice.Model;


public enum ProductStatus {
    COMMANDE(1),
    PREPARATION(20),
    AUFOUR(40),
    PRET(85),
    LIVRE(100);

    private int avancement;

    public static ProductStatus get(int avancement) {
        if (avancement == COMMANDE.avancement) {
            return COMMANDE;
        }
        if (avancement == PREPARATION.avancement) {
            return PREPARATION;
        }
        if (avancement == AUFOUR.avancement) {
            return AUFOUR;
        }
        if (avancement == PRET.avancement) {
            return PRET;
        }
        if (avancement == LIVRE.avancement) {
            return LIVRE;
        }
        return null;
    }

    private ProductStatus(int avancement) {
        this.avancement = avancement;
    }

    public int getAvancement() {
        return avancement;
    }

    public void setAvancement(int avancement) {
        this.avancement = avancement;
    }

}

